#ifndef __SKIN_DEF_H__
#define __SKIN_DEF_H__

#include <vector>

namespace SkinableGUI
{
	enum SkinControlTypeEnum
	{
		Control,
		Window,
		Button,
		BitmapButton,
		ListBox,
		Picture,
	};

	class SkinColor
	{
	public:
		int R;
		int G;
		int B;

		COLORREF ToColor()
		{
			return RGB(R,G,B);
		}
	};

	class SkinImage
	{
	public:
		CString Path;
		SkinColor TransparentColor;
		bool Transparent;

		SkinImage() :
		Transparent(false)
		{
		}
	};

	class SkinFont
	{
	public:
		SkinFont()
		{
			Size = 16;
			AntiAlias = true;
			UnderLine = false;
			TextColorSet = BackgroundColorSet = false;
		}

		CString Name;
		int Size;
		bool AntiAlias;
		bool UnderLine;
		SkinColor TextColor, BackgroundColor;

		bool TextColorSet, BackgroundColorSet;
	};

	class SkinRectangle : public CRect
	{
	public:
	};

	class SkinControlStyle
	{
	};

	class SkinWindowStyle
	{
	public:
		bool CaptionBar;

		bool MaximizeBox;
		bool MinimizeBox;
	};

	class SkinControl
	{
	public:
		typedef std::vector<SkinControl *> ControlList;

		SkinControl()
		{
			ControlType = Control;
			BackgroundImageSet = false;
			BackgroundColorSet = false;
			FontSet = false;
			PositionSet = false;
			StyleSet = false;
			ParentControl = NULL;
		}

		virtual ~SkinControl();

		unsigned int Id;
		SkinControlTypeEnum ControlType;
		ControlList Controls;
		SkinImage BackgroundImage;
		SkinColor BackgroundColor;
		SkinFont Font;
		SkinRectangle Position;
		SkinControlStyle Style;
		bool TransparentBackground;

		bool BackgroundImageSet;
		bool BackgroundColorSet;
		bool FontSet;
		bool PositionSet;
		bool StyleSet;
		bool TransparentBackgroundSet;

		SkinControl * ParentControl;
	};

	class SkinWindow : public SkinControl
	{
	public:
		SkinWindow()
		{
			ControlType = Window;

			TitleSet = WindowStyleSet = false;
		}

		virtual ~SkinWindow()
		{
		}

		CString Title;
		SkinWindowStyle WindowStyle;

		bool TitleSet;
		bool WindowStyleSet;
	};

	class SkinButton : public SkinControl
	{
	public:
		SkinButton()
		{
			ControlType = Button;
			ActionNameSet = ButtonTextSet = false;
		}

		virtual ~SkinButton()
		{
		}

		CString ActionName;
		CString ButtonText;

		bool ActionNameSet;
		bool ButtonTextSet;
	};

	class SkinBitmapButton : public SkinButton
	{
	public:
		SkinBitmapButton()
		{
			ControlType = BitmapButton;
			NormalSet =
				SelectedSet = 
				FocusSet = DisabledSet = false;
		}

		virtual ~SkinBitmapButton()
		{
		}

		SkinImage Normal, Selected, Focus, Disabled;

		bool NormalSet, SelectedSet, FocusSet, DisabledSet;
	};

	enum SkinScrollBarDock
	{
		Top,
		Left,
		Right,
		Bottom
	};

	class SkinScrollBarPos
	{
	public:
		SkinScrollBarPos()
		{
			DockSet = false;
			SizeSet = false;
		}

		SkinScrollBarDock Dock;
		SkinRectangle Size;

		bool DockSet, SizeSet;
	};

	class SkinScrollBar
	{
	public:
		SkinScrollBar()
		{
			IncImageSet =  
				DecImageSet =  
				ThumbImageSet =  
				BackgroundImageSet =  
				PositionSet = false;
		}

		virtual ~SkinScrollBar()
		{
		}

		SkinImage IncImage, DecImage, ThumbImage, BackgroundImage;
		SkinScrollBarPos Position;
		bool IncImageSet, DecImageSet, ThumbImageSet, BackgroundImageSet, PositionSet;
	};

	class SkinListBox : public SkinControl
	{
	public:
		SkinListBox()
		{
			ControlType = ListBox;
			HorzScroll = VertScroll = false;
			HorzScrollBarSet = VertScrollBarSet = false;
		}

		virtual ~SkinListBox()
		{
		}

		bool HorzScroll, VertScroll;
		SkinScrollBar HorzScrollBar, VertScrollBar;
		bool HorzScrollBarSet, VertScrollBarSet;
	};

	class SkinPictureControl : public SkinControl
	{
	public:
		SkinPictureControl()
		{
			ControlType = Picture;
			ImageSet = false;
		}

		virtual ~SkinPictureControl()
		{
		}

		SkinImage Image;
		bool ImageSet;
	};
}

#endif
